﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Furion.DependencyInjection;
using SqlSugar;
using Vboot.Core.Module.Sys;

namespace Vboot.Core.Init;

public class SysPortalInit : ITransient
{
    private readonly ISqlSugarRepository<SysPortalMain> _mainRepo;
    
    private readonly ISqlSugarRepository<SysPortalMenu> _menuRepo;

    public SysPortalInit(ISqlSugarRepository<SysPortalMain> mainRepo,
        ISqlSugarRepository<SysPortalMenu> menuRepo)
    {
        _mainRepo = mainRepo;
        _menuRepo = menuRepo;
    }
    
    public async Task initPortal() {
        SysPortalMain sysPortalMain=new SysPortalMain();
        sysPortalMain.id="sys";
        sysPortalMain.ornum=0;
        sysPortalMain.name="管理员门户";
        await _mainRepo.InsertAsync(sysPortalMain);
        
        SysPortalMain sysPortalMain2=new SysPortalMain();
        sysPortalMain2.id="sa";
        sysPortalMain2.ornum=1;
        sysPortalMain2.name="营销门户";
        await _mainRepo.InsertAsync(sysPortalMain2);
    }


    public async Task InitSysMenu()
    {
        List<SysPortalMenu> list = new List<SysPortalMenu>();
        
        SysPortalMenu home = new SysPortalMenu();
        home.id="Home";
        home.name="首页";
        home.code="Home";
        home.comp="/home/index";
        home.path="/home";
        home.ornum=0;
        home.icon="iconfont icon-shouye";
        home.avtag=true;
        home.shtag=true;
        home.type="M";
        home.porid="sys";
        list.Add(home);
        
        SysPortalMenu menu1 = new SysPortalMenu();
        menu1.id="Sys";
        menu1.name="系统管理";
        menu1.code="Sys";
        menu1.comp="LAYOUT";
        menu1.path="/sys";
        menu1.redirect="/sys/org/user";
        menu1.ornum=1;
        menu1.icon="iconfont icon-xitongshezhi";
        menu1.avtag=true;
        menu1.shtag=true;
        menu1.type="D";
        menu1.porid="sys";
        list.Add(menu1);

        SysPortalMenu menu11 = new SysPortalMenu();
        menu11.id="SysOrg";
        menu11.name="组织架构";
        menu11.code="SysOrg";
        menu11.comp="LAYOUT";
        menu11.path="/sys/org";
        menu11.redirect="/sys/org/user";
        menu11.ornum=1;
        menu11.icon="ele-OfficeBuilding";
        menu11.pid="Sys";
        menu11.avtag=true;
        menu11.shtag=true;
        menu11.type="D";
        menu11.porid="sys";
        list.Add(menu11);

        SysPortalMenu menu111 = new SysPortalMenu();
        menu111.id="SysOrgDept";
        menu111.name="部门管理";
        menu111.code="SysOrgDept";
        menu111.path="/sys/org/dept";
        menu111.comp="/sys/org/dept/index";
        menu111.ornum=10;
        menu111.icon="ele-SetUp";
        menu111.pid="SysOrg";
        menu111.catag=true;
        menu111.avtag=true;
        menu111.shtag=true;
        menu111.type="M";
        menu111.porid="sys";
        list.Add(menu111);
        
        SysPortalMenu menu111a = new SysPortalMenu();
        menu111a.id="SysOrgDeptEdit";
        menu111a.name="部门编辑";
        menu111a.code="SysOrgDeptEdit";
        menu111a.path="/sys/org/dept/edit";
        menu111a.comp="/sys/org/dept/edit";
        menu111a.ornum=11;
        menu111a.icon="iconfont icon-caidan";
        menu111a.pid="SysOrg";
        menu111a.catag=true;
        menu111a.avtag=true;
        menu111a.shtag=false;
        menu111a.type="M";
        menu111a.porid="sys";
        list.Add(menu111a);

        SysPortalMenu menu112 = new SysPortalMenu();
        menu112.id="SysOrgUser";
        menu112.name="用户管理";
        menu112.code="SysOrgUser";
        menu112.path="/sys/org/user";
        menu112.comp="/sys/org/user/index";
        menu112.ornum=20;
        menu112.icon="ele-User";
        menu112.pid="SysOrg";
        menu112.catag=true;
        menu112.avtag=true;
        menu112.shtag=true;
        menu112.type="M";
        menu112.porid="sys";
        list.Add(menu112);
        
        SysPortalMenu menu112a = new SysPortalMenu();
        menu112a.id="SysOrgUserEdit";
        menu112a.name="用户编辑";
        menu112a.code="SysOrgUserEdit";
        menu112a.path="/sys/org/user/edit";
        menu112a.comp="/sys/org/user/edit";
        menu112a.ornum=21;
        menu112a.icon="iconfont icon-caidan";
        menu112a.pid="SysOrg";
        menu112a.catag=true;
        menu112a.avtag=true;
        menu112a.shtag=false;
        menu112a.type="M";
        menu112a.porid="sys";
        list.Add(menu112a);

        SysPortalMenu menu113 = new SysPortalMenu();
        menu113.id="SysOrgPost";
        menu113.name="岗位管理";
        menu113.code="SysOrgPost";
        menu113.path="/sys/org/post";
        menu113.comp="/sys/org/post/index";
        menu113.ornum=31;
        menu113.icon="ele-Help";
        menu113.pid="SysOrg";
        menu113.catag=true;
        menu113.avtag=true;
        menu113.shtag=true;
        menu113.type="M";
        menu113.porid="sys";
        list.Add(menu113);
        
        SysPortalMenu menu113a = new SysPortalMenu();
        menu113a.id="SysOrgPostEdit";
        menu113a.name="岗位编辑";
        menu113a.code="SysOrgPostEdit";
        menu113a.path="/sys/org/post/edit";
        menu113a.comp="/sys/org/post/edit";
        menu113a.ornum=32;
        menu113a.icon="iconfont icon-caidan";
        menu113a.pid="SysOrg";
        menu113a.catag=true;
        menu113a.avtag=true;
        menu113a.shtag=false;
        menu113a.type="M";
        menu113a.porid="sys";
        list.Add(menu113a);

        SysPortalMenu menu114 = new SysPortalMenu();
        menu114.id="SysOrgGroup";
        menu114.name="群组管理";
        menu114.code="SysOrgGroup";
        menu114.path="/sys/org/group";
        menu114.comp="/sys/org/group/index";
        menu114.ornum = 40;
        menu114.icon="ele-Guide";
        menu114.pid="SysOrg";
        menu114.catag=true;
        menu114.avtag=true;
        menu114.shtag=true;
        menu114.type="M";
        menu114.porid="sys";
        list.Add(menu114);
        
        SysPortalMenu menu114a = new SysPortalMenu();
        menu114a.id="SysOrgGroupEdit";
        menu114a.name="群组编辑";
        menu114a.code="SysOrgGroupEdit";
        menu114a.path="/sys/org/group/edit";
        menu114a.comp="/sys/org/group/edit";
        menu114a.ornum=41;
        menu114a.icon="iconfont icon-caidan";
        menu114a.pid="SysOrg";
        menu114a.catag=true;
        menu114a.avtag=true;
        menu114a.shtag=false;
        menu114a.type="M";
        menu114a.porid="sys";
        list.Add(menu114a);
        
        SysPortalMenu menu12 = new SysPortalMenu();
        menu12.id="SysApi";
        menu12.name="接口管理";
        menu12.code="SysApi";
        menu12.comp="LAYOUT";
        menu12.path="/sys/api";
        menu12.redirect="/sys/api/main";
        menu12.ornum=2;
        menu12.icon="ele-Lock";
        menu12.pid="Sys";
        menu12.avtag=true;
        menu12.shtag=true;
        menu12.type="D";
        menu12.porid="sys";
        list.Add(menu12);
        
        SysPortalMenu menu121 = new SysPortalMenu();
        menu121.id="SysApiMain";
        menu121.name="接口清单";
        menu121.code="SysApiMain";
        menu121.path="/sys/api/main";
        menu121.comp="/sys/api/main/index";
        menu121.ornum=10;
        menu121.icon="ele-Tickets";
        menu121.pid="SysApi";
        menu121.catag=true;
        menu121.avtag=true;
        menu121.shtag=true;
        menu121.type="M";
        menu121.porid="sys";
        list.Add(menu121);
        
        SysPortalMenu menu121a = new SysPortalMenu();
        menu121a.id="SysApiMainEdit";
        menu121a.name="接口编辑";
        menu121a.code="SysApiMainEdit";
        menu121a.path="/sys/api/main/edit";
        menu121a.comp="/sys/api/main/edit";
        menu121a.ornum=11;
        menu121a.icon="ele-Tickets";
        menu121a.pid="SysApi";
        menu121a.catag=true;
        menu121a.avtag=true;
        menu121a.shtag=false;
        menu121a.type="M";
        menu121a.porid="sys";
        list.Add(menu121a);
        
        SysPortalMenu menu122 = new SysPortalMenu();
        menu122.id="SysApiRole";
        menu122.name="接口角色";
        menu122.code="SysApiRole";
        menu122.path="/sys/api/role";
        menu122.comp="/sys/api/role/index";
        menu122.ornum=20;
        menu122.icon="ele-Tickets";
        menu122.pid="SysApi";
        menu122.catag=true;
        menu122.avtag=true;
        menu122.shtag=true;
        menu122.type="M";
        menu122.porid="sys";
        list.Add(menu122);
        
        SysPortalMenu menu122a = new SysPortalMenu();
        menu122a.id="SysApiRoleEdit";
        menu122a.name="角色编辑";
        menu122a.code="SysApiRoleEdit";
        menu122a.path="/sys/api/role/edit";
        menu122a.comp="/sys/api/role/edit";
        menu122a.ornum=21;
        menu122a.icon="ele-Tickets";
        menu122a.pid="SysApi";
        menu122a.catag=true;
        menu122a.avtag=true;
        menu122a.shtag=false;
        menu122a.type="M";
        menu122a.porid="sys";
        list.Add(menu122a);
        
        SysPortalMenu menu13 = new SysPortalMenu();
        menu13.id="SysPortal";
        menu13.name="门户管理";
        menu13.code="SysPortal";
        menu13.comp="LAYOUT";
        menu13.path="/sys/portal";
        menu13.redirect="/sys/portal/main";
        menu13.ornum=3;
        menu13.icon="ele-Notebook";
        menu13.pid="Sys";
        menu13.avtag=true;
        menu13.shtag=true;
        menu13.type="D";
        menu13.porid="sys";
        list.Add(menu13);
        
        SysPortalMenu menu131 = new SysPortalMenu();
        menu131.id="SysPortalMain";
        menu131.name="门户清单";
        menu131.code="SysPortalMain";
        menu131.path="/sys/portal/main";
        menu131.comp="/sys/portal/main/index";
        menu131.ornum=10;
        menu131.icon="ele-Tickets";
        menu131.pid="SysPortal";
        menu131.catag=true;
        menu131.avtag=true;
        menu131.shtag=true;
        menu131.type="M";
        menu131.porid="sys";
        list.Add(menu131);
        
        SysPortalMenu menu131a = new SysPortalMenu();
        menu131a.id="SysPortalMainEdit";
        menu131a.name="门户编辑";
        menu131a.code="SysPortalMainEdit";
        menu131a.path="/sys/portal/main/edit";
        menu131a.comp="/sys/portal/main/edit";
        menu131a.ornum=11;
        menu131a.icon="ele-Tickets";
        menu131a.pid="SysPortal";
        menu131a.catag=true;
        menu131a.avtag=true;
        menu131a.shtag=false;
        menu131a.type="M";
        menu131a.porid="sys";
        list.Add(menu131a);
        
        SysPortalMenu menu132 = new SysPortalMenu();
        menu132.id="SysPortalMenu";
        menu132.name="门户菜单";
        menu132.code="SysPortalMenu";
        menu132.path="/sys/portal/menu";
        menu132.comp="/sys/portal/menu/index";
        menu132.ornum=12;
        menu132.icon="ele-Tickets";
        menu132.pid="SysPortal";
        menu132.catag=true;
        menu132.avtag=true;
        menu132.shtag=true;
        menu132.type="M";
        menu132.porid="sys";
        list.Add(menu132);

        SysPortalMenu menu132a = new SysPortalMenu();
        menu132a.id="SysPortalMenuEdit";
        menu132a.name="菜单编辑";
        menu132a.code="SysPortalMenuEdit";
        menu132a.path="/sys/portal/menu/edit";
        menu132a.comp="/sys/portal/menu/edit";
        menu132a.ornum=13;
        menu132a.icon="ele-Tickets";
        menu132a.pid="SysPortal";
        menu132a.catag=true;
        menu132a.avtag=true;
        menu132a.shtag=false;
        menu132a.type="M";
        menu132a.porid="sys";
        list.Add(menu132a);
        
        SysPortalMenu menu133 = new SysPortalMenu();
        menu133.id="SysPortalRole";
        menu133.name="门户角色";
        menu133.code="SysPortalRole";
        menu133.path="/sys/portal/role";
        menu133.comp="/sys/portal/role/index";
        menu133.ornum=14;
        menu133.icon="ele-Tickets";
        menu133.pid="SysPortal";
        menu133.catag=true;
        menu133.avtag=true;
        menu133.shtag=true;
        menu133.type="M";
        menu133.porid="sys";
        list.Add(menu133);
        
        SysPortalMenu menu133a = new SysPortalMenu();
        menu133a.id="SysPortalRoleEdit";
        menu133a.name="角色编辑";
        menu133a.code="SysPortalRoleEdit";
        menu133a.path="/sys/portal/role/edit";
        menu133a.comp="/sys/portal/role/edit";
        menu133a.ornum=15;
        menu133a.icon="ele-Tickets";
        menu133a.pid="SysPortal";
        menu133a.catag=true;
        menu133a.avtag=true;
        menu133a.shtag=false;
        menu133a.type="M";
        menu133a.porid="sys";
        list.Add(menu133a);
        
        SysPortalMenu menu14 = new SysPortalMenu();
        menu14.id="SysJob";
        menu14.name="定时任务";
        menu14.code="SysJob";
        menu14.comp = "LAYOUT";
        menu14.path="/sys/job";
        menu14.redirect="/sys/job/main";
        menu14.ornum=4;
        menu14.icon="ele-AlarmClock";
        menu14.pid="Sys";
        menu14.avtag=true;
        menu14.shtag=true;
        menu14.type="D";
        menu14.porid="sys";
        list.Add(menu14);
        
        SysPortalMenu menu141 = new SysPortalMenu();
        menu141.id="SysJobMain";
        menu141.name="任务清单";
        menu141.code="SysJobMain";
        menu141.path="/sys/job/main";
        menu141.comp="/sys/job/main/index";
        menu141.ornum=1;
        menu141.icon="ele-Tickets";
        menu141.pid="SysJob";
        menu141.catag=true;
        menu141.avtag=true;
        menu141.shtag=true;
        menu141.type="M";
        menu141.porid="sys";
        list.Add(menu141);
        
        SysPortalMenu menu141a = new SysPortalMenu();
        menu141a.id="SysJobMainEdit";
        menu141a.name="任务编辑";
        menu141a.code="SysJobMainEdit";
        menu141a.path="/sys/job/main/edit";
        menu141a.comp="/sys/job/main/edit";
        menu141a.ornum=2;
        menu141a.icon="ele-Tickets";
        menu141a.pid="SysJob";
        menu141a.catag=true;
        menu141a.avtag=true;
        menu141a.shtag=false;
        menu141a.type="M";
        menu141a.porid="sys";
        list.Add(menu141a);
        
        SysPortalMenu menu142 = new SysPortalMenu();
        menu142.id="SysJobLog";
        menu142.name="任务日志";
        menu142.code="SysJobLog";
        menu142.path="/sys/job/log";
        menu142.comp="/sys/job/log/index";
        menu142.ornum=3;
        menu142.icon="ele-Tickets";
        menu142.pid="SysJob";
        menu142.catag=true;
        menu142.avtag=true;
        menu142.shtag=true;
        menu142.type="M";
        menu142.porid="sys";
        list.Add(menu142);
        
        SysPortalMenu menu15 = new SysPortalMenu();
        menu15.id="SysLog";
        menu15.name="系统日志";
        menu15.code="SysLog";
        menu15.comp="LAYOUT";
        menu15.path="/sys/log";
        menu15.redirect="/sys/log/login";
        menu15.ornum=5;
        menu15.icon="ele-Notification";
        menu15.pid = "Sys";
        menu15.avtag=true;
        menu15.shtag=true;
        menu15.type="D";
        menu15.porid="sys";
        list.Add(menu15);
        
        SysPortalMenu menu151 = new SysPortalMenu();
        menu151.id="SysLogLogin";
        menu151.name="登录日志";
        menu151.code="SysLogLogin";
        menu151.path="/sys/log/login";
        menu151.comp="/sys/log/login/index";
        menu151.ornum=1;
        menu151.icon="ele-Tickets";
        menu151.pid="SysLog";
        menu151.catag=true;
        menu151.avtag=true;
        menu151.shtag=true;
        menu151.type="M";
        menu151.porid="sys";
        list.Add(menu151);
        
        //-----------------OA办公--------------------
        SysPortalMenu menu2 = new SysPortalMenu();
        menu2.id="Oa";
        menu2.name="OA办公";
        menu2.code="Oa";
        menu2.comp="LAYOUT";
        menu2.path="/oa";
        menu2.redirect="/oa/flow/temp";
        menu2.ornum=2;
        menu2.icon="ele-Menu";
        menu2.avtag=true;
        menu2.shtag=true;
        menu2.type="D";
        menu2.porid="sys";
        list.Add(menu2);
        
        SysPortalMenu menu21 = new SysPortalMenu();
        menu21.id="OaFlow";
        menu21.name="流程管理";
        menu21.code="OaFlow";
        menu21.comp="LAYOUT";
        menu21.path="/oa/flow";
        menu21.redirect="/oa/flow/temp";
        menu21.ornum=21;
        menu21.icon="ele-Connection";
        menu21.pid="Oa";
        menu21.avtag=true;
        menu21.shtag=true;
        menu21.type="D";
        menu21.porid="sys";
        list.Add(menu21);
        
        SysPortalMenu menu211 = new SysPortalMenu();
        menu211.id="OaFlowCate";
        menu211.name="流程分类";
        menu211.code="OaFlowCate";
        menu211.path="/oa/flow/cate";
        menu211.comp="/oa/flow/cate/index";
        menu211.ornum=211;
        menu211.icon="ele-Tickets";
        menu211.pid="OaFlow";
        menu211.catag=true;
        menu211.avtag=true;
        menu211.shtag=true;
        menu211.type="M";
        menu211.porid="sys";
        list.Add(menu211);
        
        SysPortalMenu menu211a = new SysPortalMenu();
        menu211a.id="OaFlowCateEdit";
        menu211a.name="流程分类编辑";
        menu211a.code="OaFlowCateEdit";
        menu211a.path="/oa/flow/cate/edit";
        menu211a.comp="/oa/flow/cate/edit";
        menu211a.ornum=2111;
        menu211a.icon="ele-Tickets";
        menu211a.pid="OaFlow";
        menu211a.catag=true;
        menu211a.avtag=true;
        menu211a.shtag=false;
        menu211a.type="M";
        menu211a.porid="sys";
        list.Add(menu211a);
        
        SysPortalMenu menu212 = new SysPortalMenu();
        menu212.id="OaFlowTemp";
        menu212.name="流程模板";
        menu212.code="OaFlowTemp";
        menu212.path="/oa/flow/temp";
        menu212.comp="/oa/flow/temp/index";
        menu212.ornum=212;
        menu212.icon="ele-Tickets";
        menu212.pid="OaFlow";
        menu212.catag=true;
        menu212.avtag=true;
        menu212.shtag=true;
        menu212.type="M";
        menu212.porid="sys";
        list.Add(menu212);
        
        SysPortalMenu menu212a = new SysPortalMenu();
        menu212a.id="OaFlowTempEdit";
        menu212a.name="流程模板编辑";
        menu212a.code="OaFlowTempEdit";
        menu212a.path="/oa/flow/temp/edit";
        menu212a.comp="/oa/flow/temp/edit";
        menu212a.ornum=2121;
        menu212a.icon="ele-Tickets";
        menu212a.pid="OaFlow";
        menu212a.catag=true;
        menu212a.avtag=true;
        menu212a.shtag=false;
        menu212a.type="M";
        menu212a.porid="sys";
        list.Add(menu212a);
        
        SysPortalMenu menu213 = new SysPortalMenu();
        menu213.id="OaFlowMain";
        menu213.name="流程实例";
        menu213.code="OaFlowMain";
        menu213.path="/oa/flow/main";
        menu213.comp="/oa/flow/main/index";
        menu213.ornum=213;
        menu213.icon="ele-Tickets";
        menu213.pid="OaFlow";
        menu213.catag=true;
        menu213.avtag=true;
        menu213.shtag=true;
        menu213.type="M";
        menu213.porid="sys";
        list.Add(menu213);
        
        SysPortalMenu menu213a = new SysPortalMenu();
        menu213a.id="OaFlowMainEdit";
        menu213a.name="流程实例编辑";
        menu213a.code="OaFlowMainEdit";
        menu213a.path="/oa/flow/main/edit";
        menu213a.comp="/oa/flow/main/edit";
        menu213a.ornum=2131;
        menu213a.icon="ele-Tickets";
        menu213a.pid="OaFlow";
        menu213a.catag=true;
        menu213a.avtag=true;
        menu213a.shtag=false;
        menu213a.type="M";
        menu213a.porid="sys";
        list.Add(menu213a);
        
        SysPortalMenu menu213b = new SysPortalMenu();
        menu213b.id="OaFlowMainView";
        menu213b.name="流程实例查看";
        menu213b.code="OaFlowMainView";
        menu213b.path="/oa/flow/main/view";
        menu213b.comp="/oa/flow/main/view";
        menu213b.ornum=2132;
        menu213b.icon="ele-Tickets";
        menu213b.pid="OaFlow";
        menu213b.catag=true;
        menu213b.avtag=true;
        menu213b.shtag=false;
        menu213b.type="M";
        menu213b.porid="sys";
        list.Add(menu213b);
        
        await _menuRepo.InsertAsync(list);
    }
    
     public async Task InitSaMenu()
    {
        List<SysPortalMenu> list = new List<SysPortalMenu>();
        
        SysPortalMenu home = new SysPortalMenu();
        home.id="Sa-Home";
        home.name="营销首页";
        home.code="Home";
        home.comp="/home/index2";
        home.path="/home";
        home.ornum=0;
        home.icon="iconfont icon-shouye";
        home.avtag=true;
        home.shtag=true;
        home.type="M";
        home.porid="sa";
        list.Add(home);
        
        SysPortalMenu menu1 = new SysPortalMenu();
        menu1.id="Sa-Oa";
        menu1.name="日常办公";
        menu1.code="Oa";
        menu1.comp="LAYOUT";
        menu1.path="/oa";
        menu1.redirect="/oa/flow/main";
        menu1.ornum=2;
        menu1.icon="ele-Menu";
        menu1.avtag=true;
        menu1.shtag=true;
        menu1.type="D";
        menu1.porid="sa";
        list.Add(menu1);
        
        SysPortalMenu menu11 = new SysPortalMenu();
        menu11.id="Sa-OaFlowMain";
        menu11.name="流程审批";
        menu11.code="OaFlowMain";
        menu11.path="/oa/flow/main";
        menu11.comp="/oa/flow/main/index";
        menu11.ornum=21;
        menu11.icon="ele-Tickets";
        menu11.pid="Sa-Oa";
        menu11.catag=true;
        menu11.avtag=true;
        menu11.shtag=true;
        menu11.type="M";
        menu11.porid="sa";
        list.Add(menu11);
        
        SysPortalMenu menu2 = new SysPortalMenu();
        menu2.id="Sa-SaAgent";
        menu2.name="代理商管理";
        menu2.code="SaAgent";
        menu2.comp="LAYOUT";
        menu2.path="/sa/agent";
        menu2.redirect="/sa/agent/main";
        menu2.ornum=2;
        menu2.icon="ele-GobletSquare";
        menu2.avtag=true;
        menu2.shtag=true;
        menu2.type="D";
        menu2.porid="sa";
        list.Add(menu2);
        
        SysPortalMenu menu21 = new SysPortalMenu();
        menu21.id="Sa-SaAgentMain";
        menu21.name="代理商清单";
        menu21.code="SaAgentMain";
        menu21.path="/sa/agent/main";
        menu21.comp="/sa/agent/main/index";
        menu21.ornum=21;
        menu21.icon="ele-Tickets";
        menu21.pid="Sa-SaAgent";
        menu21.catag=true;
        menu21.avtag=true;
        menu21.shtag=true;
        menu21.type="M";
        menu21.porid="sa";
        list.Add(menu21);
        
        SysPortalMenu menu21a = new SysPortalMenu();
        menu21a.id="Sa-SaAgentMainEdit";
        menu21a.name="代理商编辑";
        menu21a.code="SaAgentMainEdit";
        menu21a.path="/sa/agent/main/edit";
        menu21a.comp="/sa/agent/main/edit";
        menu21a.ornum=2;
        menu21a.icon="ele-Tickets";
        menu21a.pid="Sa-SaAgent";
        menu21a.catag=true;
        menu21a.avtag=true;
        menu21a.shtag=false;
        menu21a.type="M";
        menu21a.porid="sa";
        list.Add(menu21a);
        
        await _menuRepo.InsertAsync(list);
    }
}